package com.bwhx.eruler.service.casdilly.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.bean.casdilly.ClothesType;
import com.bwhx.eruler.dao.casdilly.ClothesTypeDAO;
import com.bwhx.eruler.service.casdilly.ClothesTypeService;

@Service
public class ClothesTypeServiceImpl implements ClothesTypeService {
	
	@Autowired
	ClothesTypeDAO  clothesTypeDAO;

	public List<ClothesType> findByTypeCPIDSerial(String contractID) {
		return clothesTypeDAO.findByTypeCPIDSerial(contractID);
	}

	@Override
	public void insert(ClothesType ct) {
		clothesTypeDAO.insert(ct);
		
	}

	@Override
	public List<ClothesType> list(Page entity) {
		return clothesTypeDAO.list(entity);
	}

	@Override
	public Integer count(ClothesType entity) {
		return clothesTypeDAO.count(entity);
	}

	@Override
	public void update(ClothesType entity) {
		clothesTypeDAO.update(entity);	
	}

	@Override
	public void delete(ClothesType entity) {
		clothesTypeDAO.delete(entity);		
	}

	@Override
	public List<ClothesType> findByTypeCategory(Integer category) {
		
 		return clothesTypeDAO.findByTypeCategory(category);		
	}

	@Override
	public List<ClothesType> findByCTNameAndTypeAndProjectSerial(ClothesType ct) {
 		return clothesTypeDAO.findByCTNameAndTypeAndProjectSerial(ct);	 
	}

	@Override
	public ClothesType findByID(ClothesType ct) {
 		return clothesTypeDAO.findByID(ct);
	}

	@Override
	public void relateClothes(ClothesType ct) {
		clothesTypeDAO.relateClothes(ct);
	}

	@Override
	public boolean saveDisplayOrder(List<ClothesType> typies) {
		return clothesTypeDAO.saveDisplayOrder(typies);
	}

	@Override
	/**
	 * 根据项目编号获取品类信息
	 * @param ct 包含项目编号的品类信息
	 * @return
	 */
	public List<ClothesType> findByClothesTypeBycPIDSerial(ClothesType ct){
		// TODO Auto-generated method stub
		return clothesTypeDAO.findByClothesTypeBycPIDSerial(ct);
	}

	 

}
